#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QTimer>
#include "dev-rsu/rsuctrl.h"
#include "dev-rsu/obuinfo.h"
#include "dev-rsu/rsumgr.h"

namespace Ui {
class Dialog;
}

class Dialog : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog(QWidget *parent = 0);
    ~Dialog();

protected:
    void addMessage(const QString &msg);

protected:
    RsuCtrl *m_pRsuCtrl;

private slots:
    void processRsuFrame(int index,quint8 nFrameIndex, quint8 nFrameType, const QByteArray &frame);
    void processRsuInitRlt(int index,int nRsuStatus, const QByteArray &baRsuInfo);
    void processPsamResetRlt(int index,int nPsamStatus, const QByteArray &baPsamInfo);
    void processPsamTrannelRlt(int index,int status, int nRltCount, const QByteArray &baCmds);
    void processSecureFileRlt(int index,const QByteArray &baSecureFile, const QByteArray &baAuthenticator, int nStatus);
    void processRsuInfoRlt(int index,const QByteArray &baRsuInfo);
//    void processNewObu(int index,ObuInfo newObu, IccInfo newIcc);
    void processNewObu(int index,ObuInfo newObu);

    void on_btnOpenRsu_clicked();

    void on_btnInitRsu_clicked();

    void on_btnDetectObu_clicked();

    void on_btnCloseRsu_clicked();

    void on_btnReopenRsu_clicked();

    void on_btnCheckRsuStatus_clicked();

    void on_btnGetRsuInfo_clicked();

    void on_btnMockRawFrame_clicked();

    void on_btnReleaseObu_clicked();
private:
    int devIndex;

private:
    Ui::Dialog *ui;
};

#endif // DIALOG_H
